<?php
$news = $this->news;
if ($news){
$firstnews=$news[0];
$secondnews=$news[1];
}
?>
<?if ($news):?>
<div class="row its-for-title"><h2 class="bigtitle">Новости</h2></div>


<div class="row" style="padding-left:20px">

    <div class="news-column" style="margin-right: 20px;">
        <a href="<?= $this->url(array('id' =>  $firstnews['id'] ), 'news_view') ?>">
               <?php if (empty( $firstnews['img'])): ?>
                   <img src="http://placehold.it/340x200" class="main">
               <?php else: ?>
                   <img class="main" src="<?php echo $this->image( $firstnews['img']) ?>" alt="<?php echo $firstnews['title'] ?>">
               <?php endif;  ?>

            <h3> <a href="<?= $this->url(array('id' => $firstnews['id']), 'news_view') ?>"><?php echo $firstnews['title'] ?></a></h3>

        <p><?= $this->truncate(strip_tags($firstnews['content']), 300) ?></p>
    </div>
    <div class="news-column">
       <h3> <a href="<?= $this->url(array('id' => $secondnews['id'] ), 'news_view') ?>" style="font-size: 18px;"><?php echo $secondnews['title'] ?></a></h3>
            <div class="its-for-small-img">
                <a href="<?= $this->url(array('id' => $secondnews['id'] ), 'news_view') ?>">
                        <?php if (empty( $secondnews['img'])): ?>
                                          <img src="http://placehold.it/160x120" class="oher">
                                      <?php else: ?>
                                          <img class="oher" src="<?php echo $this->image( $secondnews['img']) ?>" alt="<?php echo $secondnews['title'] ?>">
                                      <?php endif;  ?>
                </a>

            </div>
           <div class="ohercontent"><p><?= $this->truncate(strip_tags($secondnews['content']), 115) ?></p></div>
        <div style="clear: both"></div>
        <? foreach ($news as $key=>$article): ?>
        <?if (($key==0)||($key==1)) continue;?>
            <h4><a href="<?= $this->url(array('id' =>  $article['id']  ), 'news_view') ?>"><?= $article['title'] ?></a></h4>
        <? endforeach; ?>
    </div>
</div>
<?endif?>
<!--    --><?//Конкретная рубрика---------------------------------------------------?>
<?if ($this->rubricname&&$this->onerubricnews):?>

<div class="row its-for-title"><h2 class="bigtitle"><?php echo preg_replace("/\./"," ",$this->rubricname)?></h2></div>
<div class="row" style="padding-left:20px">
   <?foreach ($this->onerubricnews as $key=>$news2rubric):?>
    <div class="news-column" style="height: 200px; <?if ($key==0) echo "margin-right: 20px;"?>">
      <h3> <a href="<?= $this->url(array('id' =>  $news2rubric['id'] ), 'news_view') ?>" style="font-size: 18px;"><?php echo $news2rubric['title'] ?></a></h3>
           <div class="its-for-small-img">
               <a href="<?= $this->url(array('id' =>  $news2rubric['id'] ), 'news_view') ?>">
                       <?php if (empty( $news2rubric['img'])): ?>
                                         <img src="http://placehold.it/160x120" class="oher">
                                     <?php else: ?>
                                         <img class="oher" src="<?php echo $this->image( $news2rubric['img']) ?>" alt="<?php echo $news2rubric['title'] ?>">
                                     <?php endif;  ?>
               </a>

           </div>
        <div class="ohercontent"><p><?= $this->truncate(strip_tags($news2rubric['content']), 115) ?></p></div>
               <div style="clear: both"></div>

     </div>
    <? endforeach; ?>

</div>
<?endif;?>

<?php echo $this->partial('/paginator/common.phtml', array('paginator' => $this->paginator)) ?>